<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateOssConfigsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('oss_configs', function (Blueprint $table) {
            $table->id();
            $table->string('name');

            $table->string('access_id', 50);
            $table->string('access_key', 50);
            $table->string('bucket', 50);
            $table->string('endpoint', 50);
            $table->string('endpoint_internal', 50);
            $table->string('prefix', 50)->nullable();

            $table->tinyInteger('enabled')->default(0);

            $table->text('sts')->nullable();

            $table->tinyInteger('ssl')->default(0);
            $table->tinyInteger('isCName')->default(0);
            $table->tinyInteger('debug')->default(0);

            $table->string('cdnDomain')->nullable();



            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('oss_configs');
    }
}
